package ${model.packageName}.api.bean.request;

import ${model.packageName}.constant.errorcode.${model.initUpperName}ErrorCode;
import ${model.packageName}.enums.${model.initUpperName}OperationType;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.terminus.api.consts.OperationType;
import io.terminus.api.request.AbstractRequest;
import io.terminus.api.utils.ParamUtil;
import lombok.Data;

@Data
@ApiModel(value = "${model.initUpperName}UpdateRequest", description = "${model.desc}修改请求", parent = AbstractRequest.class)
public class ${model.initUpperName}UpdateRequest extends AbstractRequest {

	<#list model.fields as field>
	@ApiModelProperty(value = "${field.desc}")
	private String ${field.name};
	</#list>
	
	@Override
	public void checkParam() {
		super.checkParam();
		<#list model.fields as field>
		ParamUtil.notBlank(${field.name}, ${model.initUpperName}ErrorCode.${field.dbName?upper_case}_IS_BLANK);
		</#list>
	}
	
    @Override
    public OperationType getOperationType() {
        return ${model.initUpperName}OperationType.${model.dbName?upper_case}_UPDATE;
    }
}
